<template>
	<view class="section brand-story">
		<view class="section-title">
			<text class="title-text">品牌故事</text>
			<text class="more" @click="navigateToMore">更多 ></text>
		</view>
		<view class="story-content">
			<view class="story-card" @click="navigateToDetail(story.id)">
				<image :src="story.logo" mode="aspectFill" class="story-img"></image>
				<view class="story-info">
					<text class="story-title">{{story.title}}</text>
					<text class="story-desc">{{story.description}}</text>
					<view class="story-meta">
						<text class="story-date">{{story.date}}</text>
						<text class="story-views">{{story.views}}阅读</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import {useData} from "../../../common/useData";

// 获取品牌故事数据
const {modelData:story}=useData("/brand/story",{})

// 跳转到详情页
const navigateToDetail = (id) => {
	uni.navigateTo({
		url: `/pages/brand/story?id=${id}`
	})
}

// 跳转到更多页面
const navigateToMore = () => {
	uni.navigateTo({
		url: `/pages/brand/story-list`
	})
}
</script>

<style>
.section {
	background-color: #FFFFFF;
	padding: 20rpx;
	margin-bottom: 20rpx;
}

.section-title {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20rpx;
}

.title-text {
	font-size: 32rpx;
	font-weight: bold;
	color: #333;
	padding-left: 20rpx;
	border-left: 8rpx solid #D02B29;
}

.more {
	font-size: 24rpx;
	color: #999;
}

.story-content {
	padding: 0 10rpx;
}

.story-card {
	background-color: #F5F5F5;
	border-radius: 10rpx;
	overflow: hidden;
	box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.1);
}

.story-img {
	width: 100%;
	height: 300rpx;
}

.story-info {
	padding: 20rpx;
}

.story-title {
	font-size: 32rpx;
	font-weight: bold;
	color: #333;
	margin-bottom: 10rpx;
	display: block;
}

.story-desc {
	font-size: 26rpx;
	color: #666;
	line-height: 1.6;
	margin-bottom: 20rpx;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.story-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.story-date {
	font-size: 24rpx;
	color: #999;
}

.story-views {
	font-size: 24rpx;
	color: #999;
}
</style> 